<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>IDA SDK: Registers</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">IDA SDK
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="files.html"><span>Header&#160;Files</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Registers<div class="ingroups"><a class="el" href="group__dbg__funcs.html">Debugger functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Inspect/Manipulate registers for debugged process. </p>
<p>The debugger structure defines a set of hardware registers in debugger_t::registers IDA also recognizes register names for each defined bit in bit registers. You can use all these names to set or get a register value.</p>
<p>For example, with the x86 Userland Win32 debugger you can use register names like:</p><ul>
<li>"EAX", ... "EBP", "ESP", "EFL": for classical integer registers</li>
<li>"CS", "DS", ... : for segment registers</li>
<li>"ST0", "ST1", ... : for FPU registers</li>
<li>"CF", "PF", "AF", "ZF", ... : for special bit values </li>
</ul>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaac94fe8219194588151ff8c4ee9a6600"><td class="memItemLeft" align="right" valign="top">bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__regs.html#gaac94fe8219194588151ff8c4ee9a6600">get_reg_val</a> (const char *regname, <a class="el" href="structregval__t.html">regval_t</a> *regval)</td></tr>
<tr class="memdesc:gaac94fe8219194588151ff8c4ee9a6600"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a register value from the current thread.  <a href="#gaac94fe8219194588151ff8c4ee9a6600">More...</a><br /></td></tr>
<tr class="separator:gaac94fe8219194588151ff8c4ee9a6600"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga60d388a8b0de1319c6eae53cf8544c1f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga60d388a8b0de1319c6eae53cf8544c1f"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__regs.html#ga60d388a8b0de1319c6eae53cf8544c1f">get_reg_val</a> (const char *regname, <a class="el" href="pro_8h.html#a2f5563986d7f95e4fad5876c17d9cdda">uint64</a> *ival)</td></tr>
<tr class="memdesc:ga60d388a8b0de1319c6eae53cf8544c1f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get register value as an unsigned 64-bit int. <br /></td></tr>
<tr class="separator:ga60d388a8b0de1319c6eae53cf8544c1f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga29393f12b1896a755bbfc5a96e7b91b1"><td class="memItemLeft" align="right" valign="top">bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__regs.html#ga29393f12b1896a755bbfc5a96e7b91b1">get_sp_val</a> (<a class="el" href="pro_8h.html#a7b0aeaed04e477c02cf8ea3452002d1a">ea_t</a> *out_spval)</td></tr>
<tr class="memdesc:ga29393f12b1896a755bbfc5a96e7b91b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get value of the SP register for the current thread.  <a href="#ga29393f12b1896a755bbfc5a96e7b91b1">More...</a><br /></td></tr>
<tr class="separator:ga29393f12b1896a755bbfc5a96e7b91b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9cd2829876042f27da2f36c645c4cb44"><td class="memItemLeft" align="right" valign="top">bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__regs.html#ga9cd2829876042f27da2f36c645c4cb44">get_ip_val</a> (<a class="el" href="pro_8h.html#a7b0aeaed04e477c02cf8ea3452002d1a">ea_t</a> *out_ipval)</td></tr>
<tr class="memdesc:ga9cd2829876042f27da2f36c645c4cb44"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get value of the IP (program counter) register for the current thread.  <a href="#ga9cd2829876042f27da2f36c645c4cb44">More...</a><br /></td></tr>
<tr class="separator:ga9cd2829876042f27da2f36c645c4cb44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaba72f05c6a4861033d467737fec81c10"><td class="memItemLeft" align="right" valign="top">bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__regs.html#gaba72f05c6a4861033d467737fec81c10">set_reg_val</a> (const char *regname, const <a class="el" href="structregval__t.html">regval_t</a> *regval)</td></tr>
<tr class="memdesc:gaba72f05c6a4861033d467737fec81c10"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write a register value to the current thread.  <a href="#gaba72f05c6a4861033d467737fec81c10">More...</a><br /></td></tr>
<tr class="separator:gaba72f05c6a4861033d467737fec81c10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga80bbe9e841d606d88a2f20e14f308eb3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga80bbe9e841d606d88a2f20e14f308eb3"></a>
bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__regs.html#ga80bbe9e841d606d88a2f20e14f308eb3">request_set_reg_val</a> (const char *regname, const <a class="el" href="structregval__t.html">regval_t</a> *regval)</td></tr>
<tr class="memdesc:ga80bbe9e841d606d88a2f20e14f308eb3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Post a <a class="el" href="group__dbg__funcs__regs.html#gaba72f05c6a4861033d467737fec81c10" title="Write a register value to the current thread. ">set_reg_val()</a> request. <br /></td></tr>
<tr class="separator:ga80bbe9e841d606d88a2f20e14f308eb3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8031b3884a4df4e6450fce9261a3885a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8031b3884a4df4e6450fce9261a3885a"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__regs.html#ga8031b3884a4df4e6450fce9261a3885a">set_reg_val</a> (const char *regname, <a class="el" href="pro_8h.html#a2f5563986d7f95e4fad5876c17d9cdda">uint64</a> ival)</td></tr>
<tr class="memdesc:ga8031b3884a4df4e6450fce9261a3885a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write a register value to the current thread. <br /></td></tr>
<tr class="separator:ga8031b3884a4df4e6450fce9261a3885a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabd263cd93f4d01345d687c7e5a1176e7"><td class="memItemLeft" align="right" valign="top">bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__regs.html#gabd263cd93f4d01345d687c7e5a1176e7">is_reg_integer</a> (const char *regname)</td></tr>
<tr class="memdesc:gabd263cd93f4d01345d687c7e5a1176e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Does a register contain an integer value?  <a href="#gabd263cd93f4d01345d687c7e5a1176e7">More...</a><br /></td></tr>
<tr class="separator:gabd263cd93f4d01345d687c7e5a1176e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8945a7732adce3accc70fb5a940b1450"><td class="memItemLeft" align="right" valign="top">bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__regs.html#ga8945a7732adce3accc70fb5a940b1450">is_reg_float</a> (const char *regname)</td></tr>
<tr class="memdesc:ga8945a7732adce3accc70fb5a940b1450"><td class="mdescLeft">&#160;</td><td class="mdescRight">Does a register contain a floating point value?  <a href="#ga8945a7732adce3accc70fb5a940b1450">More...</a><br /></td></tr>
<tr class="separator:ga8945a7732adce3accc70fb5a940b1450"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga708fad2035f59f04662f840f5de78000"><td class="memItemLeft" align="right" valign="top">bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbg__funcs__regs.html#ga708fad2035f59f04662f840f5de78000">is_reg_custom</a> (const char *regname)</td></tr>
<tr class="memdesc:ga708fad2035f59f04662f840f5de78000"><td class="mdescLeft">&#160;</td><td class="mdescRight">Does a register contain a value of a custom data type?  <a href="#ga708fad2035f59f04662f840f5de78000">More...</a><br /></td></tr>
<tr class="separator:ga708fad2035f59f04662f840f5de78000"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gaac94fe8219194588151ff8c4ee9a6600"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> get_reg_val </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>regname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structregval__t.html">regval_t</a> *&#160;</td>
          <td class="paramname"><em>regval</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Read a register value from the current thread. </p>
<table class="doxtable">
<tr>
<td>Type</td><td>Synchronous function </td></tr>
<tr>
<td>Notification</td><td>none (synchronous function) </td></tr>
</table>

</div>
</div>
<a class="anchor" id="ga29393f12b1896a755bbfc5a96e7b91b1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> get_sp_val </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="pro_8h.html#a7b0aeaed04e477c02cf8ea3452002d1a">ea_t</a> *&#160;</td>
          <td class="paramname"><em>out_spval</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get value of the SP register for the current thread. </p>
<p>Requires a suspended debugger. </p>

</div>
</div>
<a class="anchor" id="ga9cd2829876042f27da2f36c645c4cb44"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> get_ip_val </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="pro_8h.html#a7b0aeaed04e477c02cf8ea3452002d1a">ea_t</a> *&#160;</td>
          <td class="paramname"><em>out_ipval</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get value of the IP (program counter) register for the current thread. </p>
<p>Requires a suspended debugger. </p>

</div>
</div>
<a class="anchor" id="gaba72f05c6a4861033d467737fec81c10"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> set_reg_val </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>regname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structregval__t.html">regval_t</a> *&#160;</td>
          <td class="paramname"><em>regval</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Write a register value to the current thread. </p>
<table class="doxtable">
<tr>
<td>Type</td><td>Synchronous function - available as Request </td></tr>
<tr>
<td>Notification</td><td>none (synchronous function) </td></tr>
</table>

</div>
</div>
<a class="anchor" id="gabd263cd93f4d01345d687c7e5a1176e7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> is_reg_integer </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>regname</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Does a register contain an integer value? </p>
<table class="doxtable">
<tr>
<td>Type</td><td>Synchronous function </td></tr>
<tr>
<td>Notification</td><td>none (synchronous function) </td></tr>
</table>

</div>
</div>
<a class="anchor" id="ga8945a7732adce3accc70fb5a940b1450"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> is_reg_float </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>regname</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Does a register contain a floating point value? </p>
<table class="doxtable">
<tr>
<td>Type</td><td>Synchronous function </td></tr>
<tr>
<td>Notification</td><td>none (synchronous function) </td></tr>
</table>

</div>
</div>
<a class="anchor" id="ga708fad2035f59f04662f840f5de78000"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a> is_reg_custom </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>regname</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Does a register contain a value of a custom data type? </p>
<table class="doxtable">
<tr>
<td>Type</td><td>Synchronous function </td></tr>
<tr>
<td>Notification</td><td>none (synchronous function) </td></tr>
</table>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
